<template>
  <div>
    <nav-bar class="nav-bar-position">我的成绩单</nav-bar>
    <web-view :src="`https://build.fangti.com?u_id=${ u_id }&id=${ id }`" @message="share"/>
  </div>
</template>

<script>
  import { Toast } from "../../utils/modal";

  export default {
    name: "course_share",
    data() {
      return {
        show: true,
        u_id: '',
        id: ''
      }
    },
    onLoad(e) {
      const { u_id, id } = e;
      this.u_id = u_id;
      this.id = id;
      console.log(e);
    },
    methods: {
      share() {
        const { u_id, id } = this;
        uni.share({
          provider: "weixin",
          scene: "WXSenceTimeline",
          type: 0,
          href: `https://build.fangti.com?u_id=${ u_id }&id=${ id }`,
          title: "我的成绩单",
          summary: "分享我的成绩单",
          imageUrl: 'https://language.fangti.com/img/ico_beans@2x.png',
          success: function (res) {
            console.log("success:" + JSON.stringify(res));
          },
          fail: function (err) {
            console.log("fail:" + JSON.stringify(err));
            Toast({ title: '微信未安装,无法分享' })
          }
        });
      }
    }
  }
</script>

<style scoped>

</style>
